Fix suggestion spans inside macros for the unused_must_use lint#143030
Merged
bors merged 2 commits intorust-lang:masterfrom Jun 29, 2025
Merged
Fix suggestion spans inside macros for the unused_must_use lint#143030bors merged 2 commits intorust-lang:masterfrom
unused_must_use lint#143030bors merged 2 commits intorust-lang:masterfrom
Conversation
Collaborator
|
r? @SparrowLii rustbot has assigned @SparrowLii. Use |
This comment has been minimized.
This comment has been minimized.
Member
|
@bors r+ |
Collaborator
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Jun 26, 2025
Fix suggestion spans inside macros for the `unused_must_use` lint This PR fixes the suggestion spans inside macros for the `unused_must_use` lint by trying to find the oldest ancestor span. Fixes rust-lang#143025
bors
added a commit
that referenced
this pull request
Jun 26, 2025
Rollup of 9 pull requests Successful merges: - #124595 (Suggest cloning `Arc` moved into closure) - #139594 (Simplify `ObligationCauseCode::IfExpression`) - #141311 (make `tidy-alphabetical` use a natural sort) - #141648 ([rustdoc] Do not emit redundant_explicit_links lint if the doc comment comes from expansion) - #142285 (tests: Do not run afoul of asm.validity.non-exhaustive in input-stats) - #142393 (Don't give APITs names with macro expansion placeholder fragments in it) - #142884 (StableMIR: Add method to retrieve body of coroutine) - #142981 (Make missing lifetime suggestion verbose) - #143030 (Fix suggestion spans inside macros for the `unused_must_use` lint) r? `@ghost` `@rustbot` modify labels: rollup
Member
|
@bors r- |
Member
Author
|
@ehuss @weihanglo I'm not sure how to fix the your test. With this PR are no longer suggesting inside the macro, which is exactly what your test was testing. Any idea how to fix it/unblock this PR? We are also generating a FWC warning, but that's not the real issue. |
github-merge-queue bot
pushed a commit
to rust-lang/cargo
that referenced
this pull request
Jun 28, 2025
) ### What does this PR try to resolve? This PR changes the triggering `rustc` lint in the `fix_only_once_for_duplicates` test from `unused_must_use` to `forgetting_references`, because we are changing in rust-lang/rust#143030 the interaction between that lint and macros. This is required as it blocking the rust PR, rust-lang/rust#143030 (comment). ### How to test and review this PR? Look at the test changes.
Member
Author
|
The Cargo test has been fixed in rust-lang/cargo#15713 which has been pulled by #143160. @bors r=SparrowLii |
Collaborator
bors
added a commit
that referenced
this pull request
Jun 29, 2025
Rollup of 4 pull requests Successful merges: - #142078 (Add SIMD funnel shift and round-to-even intrinsics) - #142214 (`tests/ui`: A New Order [9/N]) - #142417 (`tests/ui`: A New Order [12/N]) - #143030 (Fix suggestion spans inside macros for the `unused_must_use` lint) r? `@ghost` `@rustbot` modify labels: rollup
RalfJung
pushed a commit
to RalfJung/miri
that referenced
this pull request
Jun 29, 2025
Rollup of 4 pull requests Successful merges: - rust-lang/rust#142078 (Add SIMD funnel shift and round-to-even intrinsics) - rust-lang/rust#142214 (`tests/ui`: A New Order [9/N]) - rust-lang/rust#142417 (`tests/ui`: A New Order [12/N]) - rust-lang/rust#143030 (Fix suggestion spans inside macros for the `unused_must_use` lint) r? `@ghost` `@rustbot` modify labels: rollup
Kobzol
pushed a commit
to Kobzol/rustc_codegen_cranelift
that referenced
this pull request
Dec 29, 2025
Rollup of 4 pull requests Successful merges: - rust-lang/rust#142078 (Add SIMD funnel shift and round-to-even intrinsics) - rust-lang/rust#142214 (`tests/ui`: A New Order [9/N]) - rust-lang/rust#142417 (`tests/ui`: A New Order [12/N]) - rust-lang/rust#143030 (Fix suggestion spans inside macros for the `unused_must_use` lint) r? `@ghost` `@rustbot` modify labels: rollup
christian-schilling
pushed a commit
to christian-schilling/rustc_codegen_cranelift
that referenced
this pull request
Jan 27, 2026
Rollup of 4 pull requests Successful merges: - rust-lang/rust#142078 (Add SIMD funnel shift and round-to-even intrinsics) - rust-lang/rust#142214 (`tests/ui`: A New Order [9/N]) - rust-lang/rust#142417 (`tests/ui`: A New Order [12/N]) - rust-lang/rust#143030 (Fix suggestion spans inside macros for the `unused_must_use` lint) r? `@ghost` `@rustbot` modify labels: rollup
christian-schilling
pushed a commit
to christian-schilling/rustc_codegen_cranelift
that referenced
this pull request
Jan 27, 2026
Rollup of 4 pull requests Successful merges: - rust-lang/rust#142078 (Add SIMD funnel shift and round-to-even intrinsics) - rust-lang/rust#142214 (`tests/ui`: A New Order [9/N]) - rust-lang/rust#142417 (`tests/ui`: A New Order [12/N]) - rust-lang/rust#143030 (Fix suggestion spans inside macros for the `unused_must_use` lint) r? `@ghost` `@rustbot` modify labels: rollup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes the suggestion spans inside macros for the
unused_must_uselint by trying to find the oldest ancestor span.Fixes #143025